<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="XBitacoraCreateDlg" widgetVar="XBitacoraCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{seriesBundle.CreateXBitacoraTitle}" closeOnEscape="true">

            <h:form id="XBitacoraCreateForm">

                <h:panelGroup id="display" rendered="#{xBitacoraController.selected != null}">
                    <p:panelGrid columns="2" columnClasses="column">

                        <p:outputLabel value="#{seriesBundle.CreateXBitacoraLabel_tabla}" for="tabla" />
                        <h:panelGroup>
                            <p:inputText id="tabla" value="#{xBitacoraController.selected.tabla}" title="#{seriesBundle.CreateXBitacoraTitle_tabla}" required="true" requiredMessage="#{seriesBundle.CreateXBitacoraRequiredMessage_tabla}" size="50" maxlength="50"/>
                            <p:tooltip for="tabla" value="#{xBitacoraController.getComponentMessages('tabla', seriesBundle.CreateXBitacoraHelpText_tabla)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateXBitacoraLabel_accion}" for="accion" />
                        <h:panelGroup>
                            <p:inputText id="accion" value="#{xBitacoraController.selected.accion}" title="#{seriesBundle.CreateXBitacoraTitle_accion}" required="true" requiredMessage="#{seriesBundle.CreateXBitacoraRequiredMessage_accion}" size="1" maxlength="1"/>
                            <p:tooltip for="accion" value="#{xBitacoraController.getComponentMessages('accion', seriesBundle.CreateXBitacoraHelpText_accion)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateXBitacoraLabel_dml}" for="dml" />
                        <h:panelGroup>
                            <p:inputTextarea rows="4" cols="30" id="dml" value="#{xBitacoraController.selected.dml}" title="#{seriesBundle.CreateXBitacoraTitle_dml}" required="true" requiredMessage="#{seriesBundle.CreateXBitacoraRequiredMessage_dml}"/>
                            <p:tooltip for="dml" value="#{xBitacoraController.getComponentMessages('dml', seriesBundle.CreateXBitacoraHelpText_dml)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateXBitacoraLabel_fecha}" for="fecha" />
                        <h:panelGroup>
                            <p:calendar id="fecha" pattern="MM/dd/yyyy HH:mm:ss" value="#{xBitacoraController.selected.fecha}" title="#{seriesBundle.CreateXBitacoraTitle_fecha}" required="true" requiredMessage="#{seriesBundle.CreateXBitacoraRequiredMessage_fecha}" showOn="button"/>
                            <p:tooltip for="fecha" value="#{xBitacoraController.getComponentMessages('fecha', seriesBundle.CreateXBitacoraHelpText_fecha)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.CreateXBitacoraLabel_idUsuario}" for="idUsuario" />
                        <h:panelGroup>
                            <p:selectOneMenu id="idUsuario" value="#{xBitacoraController.selected.idUsuario}"  converter="xUsuarioConverter">
                                <f:selectItem itemLabel="#{seriesBundle.SelectOneMessage}"/>
                                <f:selectItems value="#{xUsuarioController.items}"
                                               var="idUsuarioItem"
                                               itemValue="#{idUsuarioItem}"
                                               itemLabel="#{idUsuarioItem.idUsuario.toString()}"
                                               />

                            </p:selectOneMenu>
                            <p:tooltip for="idUsuario" value="#{xBitacoraController.getComponentMessages('idUsuario', seriesBundle.CreateXBitacoraHelpText_idUsuario)}"/>
                        </h:panelGroup>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{xBitacoraController.saveNew}" value="#{seriesBundle.Save}" update="display,:XBitacoraListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,PF('XBitacoraCreateDialog'));">
                        <p:confirm header="#{seriesBundle.ConfirmationHeader}" message="#{seriesBundle.ConfirmCreateMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>

                    <p:commandButton value="#{seriesBundle.Cancel}" onclick="PF('XBitacoraCreateDialog').hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
